<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3c.org/TR/1999/REC-html401-19991224/loose.dtd">
<HTML xmlns="http://www.w3.org/1999/xhtml"><HEAD>
<title><%= site_title %></title>
<META http-equiv=Content-Type content="text/html; charset=utf-8"/>
<meta name="verify-v1" content="nnLigvnRl20l3cM6/2BKYRlu4jYBViT7SjsBf3S7xxg=" />
<META name="y_key" content="fbe5d8f870aa3992" />
<%= stylesheet_link_tag 'main' %>
<%= stylesheet_link_tag 'tabs' %>
<%= stylesheet_link_tag 'global' %>
<%= stylesheet_link_tag 'niftyCorners' %>

<!--[if lte IE 6]>
<%= stylesheet_link_tag 'ie6' %>
<![endif]--><!--[if gt IE 6]>
<%= stylesheet_link_tag 'ie7' %>
<![endif]-->

<%= javascript_include_tag "prototype"%>
<%= javascript_include_tag "jquery"%>
<%= javascript_include_tag "utils"%>
<%= javascript_include_tag "jquery-dom"%>
<%= javascript_include_tag "fckeditor" %>
<%= javascript_include_tag "niftycube" %>
<script type="text/javascript">
window.onload=function(){
    Nifty("div#notice","small");
    Nifty("div.side_notice_box","small");
}
</script>
<% unless @feed_icons.blank? -%>
  <% @feed_icons.each do |feed| -%>
    <%= auto_discovery_link_tag :rss, feed[:url], :title => "Subscribe to '#{feed[:title]}'" %>
  <% end -%>
<% end -%>
</HEAD>
<BODY>
  <DIV id=container>
    <DIV id=h>
        <H1>
            <%= link_to "首页", :controller => "browse", :action => "index" %>
        </H1>
        <% if current_user.nil? -%>
            <%= link_to '注册', signup_users_path, :class => "header-join" %>
            <%= link_to '登录', login_users_path, :class => "header-login", :onclick => "return(toggleLogin())" %>
        <DIV id=login-form style="DISPLAY: none">
            <% form_tag login_users_path, :method => :post, :id => "side-login" do -%>
                <LABEL for=side-username>用户名</LABEL>
                <%= text_field_tag 'login' %>
                <LABEL for=side-password>密码</LABEL>
                <%= password_field_tag 'password' %>
                <LABEL for=side-persistent>记住我?</LABEL>
                <%= check_box_tag 'remember_me' %>
                <input type="hidden" value="<%= request.request_uri%>" name="redir"/>
                <INPUT class=log2 tabIndex=4 type=image src="/images/login-go.gif" value=Go name=submit>
            <% end -%>
        </DIV>
        <% else -%>
            <%= link_to "#{current_user.display_name}", user_path(current_user.login), :class => "header-settings" %>
            <%= link_to "修改资料", edit_user_path(current_user.login), :class => "header-my" %>
            <% if !current_user.nil? && !current_user.community.nil? -%>
                <%= link_to '我的社区', community_path(current_user.community.district, current_user.community), :class => "header-my" %>
            <% else -%>
                <a href="/communities/life" class="header-my">我的社区</a>
            <% end -%>
            <%= link_to '好友', friends_user_path(current_user.login), :class => "header-my" %>
            <% if unread_messages_num.to_i > 0-%>
            <%= link_to "消息(#{unread_messages_num})", messages_path, :class => "header-my" %>
            <% else -%>
            <%= link_to "消息", messages_path, :class => "header-my" %>
            <% end -%>
            <%= link_to '邀请', invite_users_path, :class => "header-my" %>
            <%= link_to '退出', logout_users_path, :class => "header-my" %>
        <% end -%>
        
        <DIV class=side-header>
            <% form_tag url_for(:controller => "search", :action => "q"), :method => :get, :id => "search" do -%>
                <input name="k" type="text" value="<%= params[:k]%>" size=25 id=top-keywords/>
                <INPUT id=top-submit type=image alt=Search src="/images/search.gif"/>
            <% end -%>
        </DIV>
        
        <DIV id=h-sec>
            <%= render :partial => "shared/categories.rhtml"%>
            <DIV>
                <%= link_to '<STRONG>小组</STRONG>', groups_path, :class => "current", :id => "h-popular" %>
                <%= link_to '<STRONG>论坛</STRONG>', forums_path, :class => "current", :id => "h-popular" %>
            </DIV>
        </DIV>
    </DIV>
    <DIV id=contents>
        <DIV id=wrapper>
            <DIV class=sidebar>
                <DIV class=side-container>
                    <%= @content_for_sidebar %>
                </DIV>
            </DIV>
            
            <DIV class=main>
                <%= @content_for_navbar %>
                    <% unless flash[:notice].nil? -%>
                    <table align=center id="notice_table">
                        <tr>
                            <td>
                                <div id=notice>
                                    <%= image_tag("information.png", :align=>"absmiddle")%> <%= flash[:notice] %>
                                    <a href="#" id="close_notice" onclick="$j('#notice_table').hide();return false">关闭</a>
                                </div>
                            </td>
                        </tr>
                    </table>
                    <% end -%>
                <%= @content_for_layout %>
            </DIV>
            
            <BR style="CLEAR: both">
        </DIV>
    </DIV>
    <DIV id=footer>
      <DIV class=footer-contents>
            <center><%= link_to '关于您这儿', :controller => 'about', :action => 'index'%> - <%= link_to '联系我们', forum_path(8318)%> - <%= link_to '提提意见', comments_path %> - <%= link_to '友情链接', :controller => 'about', :action => 'links'%> - <%= link_to '帮助', :controller => 'help', :action => 'index'%> - ©2008 <%= link_to "您这儿", :controller => "browse", :action => "index" %> | <script type="text/javascript" src="http://js.tongji.yahoo.com.cn/1/184/460/ystat.js"></script> | <a href="http://www.xiaake.cn/" title="虾客网" target="_blank">虾客网</a></center>
      </DIV>
      <BR style="CLEAR: both">
    </DIV>
    
    <SCRIPT type="text/javascript">handleHover();</SCRIPT>
    <script type="text/javascript">
    var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
    document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
    </script>
    <script type="text/javascript">
    var pageTracker = _gat._getTracker("UA-1565522-2");
    pageTracker._initData();
    pageTracker._trackPageview();
    </script>
    
  </DIV>
</BODY>
</HTML>